home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / MATHS / ARCAUT / Automatons / DLA < prev    next >
Text File  |  1991-07-27  |  2KB  |  57 lines

  1. AUTOMATON*
  2.  
  3.   DLA
  4.  
  5.   This is an interesting automaton. It simulates the physical process known
  6.   as diffusion limited aggregation. An example screen of a typical resultant
  7.   object, known as a dendrite, is included in the screens directory, disc
  8.   space permitting; to view it run the automaton with a window 256x256, click
  9.   menu, select the load option & enter the name 'den1'. The process of DLA
  10.   works as follows. Take an initial seed, in this case a point & introduce
  11.   some randomly moving particles (as in the Brownian Motion automaton). Allow
  12.   the particles to wander until one comes close to the seed; as soon as this
  13.   happens, the particle concerned 'adheres' to the seed & becomes a part of
  14.   it. This results in a gradually growing stable structure, the shape of
  15.   which should be quite familiar - similar processes frequently occur in
  16.   nature; for example the way that frost spreads across a window or mould
  17.   grows on a wall. Differing degrees of stringiness/clumping can be produced
  18.   by altering the initial density of wandering particles; this is controlled
  19.   by the final parameter in the call to PROCsoup below. You might also like
  20.   to try using a more complex initial seed, such as a line or circle. The
  21.   Margolus neighbourhood is of course used, to enable the easy programming
  22.   required to make the particles wander. A window of 50x50 will very quickly
  23.   give you a good idea of how the process works; a full screen version
  24.   (256x256), with the initial density below of 20 percent will take about
  25.   half an hour until all particles are caught.
  26.  
  27. INITIALISATION*
  28.  
  29.   10DEF PROCdo
  30.   20*SetEval wrap on
  31.   30*SetEval neig margolus
  32.   40*SetEval rndb -1
  33.   50*SetEval i 1
  34.   60*SetEval t 249
  35.   70*SetEval b 17
  36.   80ENDPROC
  37.  
  38. SCREEN*
  39.  
  40.   10DEF PROCdo
  41.   20c%=FNacol(45)
  42.   30PROCsoup(255,1,.2)
  43.   40GCOL c%AND63 TINT c%:POINT 0,0
  44.   50ENDPROC
  45.  
  46. CODE*
  47.  
  48. ( READ_NEIG
  49.   CELL IF (CELL 255 <>  IF (CELL ==))
  50.   1 254 MCOUNT_NEIG IF (CELL IF (
  51.                  OPP IF (OPP 255 <> IF (OPP <i> - DUP <b> >= IF (==) <t> ==))
  52.                   CW IF ( CW 255 <> IF ( CW <i> - DUP <b> >= IF (==) <t> ==))
  53.                                         CCW <i> - DUP <b> >= IF (==) <t> == )
  54.                                                                     CELL == )
  55.               2RNDB IF (CCW  ==) CW  ==                                     )
  56.  
  57. END*